<?php
/**
 * 分类列表下的素材
 */
require_once dirname(dirname(__DIR__))."/common.php";
use app\cls\tom\Response;
use app\cls\tom\SysResource;
use app\model\UserMaterial;
//实例化数据库
$db = SysResource::getDB(false);
$UserMaterial = new UserMaterial($db);

$fenlie_id=$_REQUEST['fenlie_id'];
if(empty($fenlie_id)){
    Response::output(-1,"缺少参数");
}
//分页
$page = isset($_REQUEST["page"]) ? intval($_REQUEST["page"]) : 1;
$page = $page > 0 ? $page : 1;
$pageSize =10;
$da1=$UserMaterial->dub_fenlie_list($page,$pageSize,$fenlie_id);
if(empty($da1)){
    Response::output(0,"查询成功",[],0);
}else{
    foreach($da1 as $k=>&$v){
        if(empty($v['video_share_pic'])){
            $v['share_pic']="";
        }else{
            $v['share_pic']=$v['video_share_pic'];
        }
    }
    Response::output(0,"查询成功",$da1);
}
